CREATE EXTERNAL TABLE IF NOT EXISTS jms_ods.yl_lmdm_sys_special_time_limit(
id                                                bigint                        COMMENT '主键id',
combine_key                                       String                        COMMENT '组合key md5(网点id+加时类型id+班次+国家+省+市+区+乡镇)',
network_id                                        bigint                        COMMENT '网点id',
extra_time_type                                   smallint                      COMMENT '加时类型:1收件加时,2派件加时',
extra_time                                        String                        COMMENT '加时时效',
shift                                             smallint                      COMMENT '班次',
country_id                                        bigint                        COMMENT '国家id',
provider_id                                       bigint                        COMMENT '省份id',
city_id                                           bigint                        COMMENT '城市id',
area_id                                           bigint                        COMMENT '区/县id',
township_id                                       bigint                        COMMENT '乡镇id',
special_address                                   String                        COMMENT '特殊地址',
is_enable                                         smallint                      COMMENT '是否启用:1启用,2不启用',
is_delete                                         smallint                      COMMENT '是否删除:1未删除,2已删除',
create_by                                         bigint                        COMMENT '创建人id',
update_by                                         bigint                        COMMENT '最后更新人id',
create_by_name                                    String                        COMMENT '创建人名称',
update_by_name                                    String                        COMMENT '最后修改人名称',
create_time                                       timestamp                     COMMENT '创建时间',
update_time                                       timestamp                     COMMENT '更新时间',
distance_to_town                                  Double                        COMMENT '到乡镇距离',
audit_status                                      smallint                      COMMENT '审核状态  0待审核 1已审核 2已驳回',
effective_time                                    timestamp                     COMMENT '生效时间',
effective_status                                  smallint                      COMMENT '生效状态 0待生效  1生效中  2失效中',
expire_time                                       timestamp                     COMMENT '失效时间',
audit_by                                          bigint                        COMMENT '审核人id',
audit_by_name                                     String                        COMMENT '审核人',
audit_refuse_reason                               String                        COMMENT '驳回原因',
batch_no                                          String                        COMMENT '批次号',
batch_no_serial                                   bigint                        COMMENT '批次号-序列号',
parent_id                                         bigint                        COMMENT '父id'
)
COMMENT '特殊时效维护表'
PARTITIONED BY (dt STRING COMMENT '更新/创建日期 (yyyy-MM-dd)')
STORED AS PARQUET
LOCATION '/dw/hive/jms_ods.db/external/yl_lmdm_sys_special_time_limit'
TBLPROPERTIES (
  'parquet.column.index.access'='true'
);

MSCK REPAIR TABLE jms_ods.yl_lmdm_sys_special_time_limit;